package cn.iocoder.yudao.module.ai.dal.mysql.modelfactory;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.ai.dal.dataobject.modelfactory.ModelFactoryDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.ai.controller.admin.modelfactory.vo.*;

/**
 * 模型车间 Mapper
 *
 * @author gt
 */
@Mapper
public interface ModelFactoryMapper extends BaseMapperX<ModelFactoryDO> {

    default PageResult<ModelFactoryDO> selectPage(ModelFactoryPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ModelFactoryDO>()
                .likeIfPresent(ModelFactoryDO::getModelName, reqVO.getModelName())
                .likeIfPresent(ModelFactoryDO::getModelChinessName, reqVO.getModelChinessName())
                .eqIfPresent(ModelFactoryDO::getVersion, reqVO.getVersion())
                .eqIfPresent(ModelFactoryDO::getIndustryBelonging, reqVO.getIndustryBelonging())
                .eqIfPresent(ModelFactoryDO::getIndustrySecondBelonging, reqVO.getIndustrySecondBelonging())
                .eqIfPresent(ModelFactoryDO::getIndustryThirdBelonging, reqVO.getIndustryThirdBelonging())
                .eqIfPresent(ModelFactoryDO::getTestDuration, reqVO.getTestDuration())
                .eqIfPresent(ModelFactoryDO::getCorrectRate, reqVO.getCorrectRate())
                .eqIfPresent(ModelFactoryDO::getModelType, reqVO.getModelType())
                .eqIfPresent(ModelFactoryDO::getModelSecondType, reqVO.getModelSecondType())
                .eqIfPresent(ModelFactoryDO::getAlgorithmType, reqVO.getAlgorithmType())
                .eqIfPresent(ModelFactoryDO::getModelDesc, reqVO.getModelDesc())
                .eqIfPresent(ModelFactoryDO::getPerformanceMetric, reqVO.getPerformanceMetric())
                .eqIfPresent(ModelFactoryDO::getKeyAdvantage, reqVO.getKeyAdvantage())
                .eqIfPresent(ModelFactoryDO::getModelImage, reqVO.getModelImage())
                .eqIfPresent(ModelFactoryDO::getDemoVideo, reqVO.getDemoVideo())
                .eqIfPresent(ModelFactoryDO::getHardware, reqVO.getHardware())
                .eqIfPresent(ModelFactoryDO::getIsFrameDetection, reqVO.getIsFrameDetection())
                .eqIfPresent(ModelFactoryDO::getIsImage, reqVO.getIsImage())
                .eqIfPresent(ModelFactoryDO::getIsAutoStart, reqVO.getIsAutoStart())
                .eqIfPresent(ModelFactoryDO::getIsGpuCard, reqVO.getIsGpuCard())
                .eqIfPresent(ModelFactoryDO::getModelZipPath, reqVO.getModelZipPath())
                .eqIfPresent(ModelFactoryDO::getSuplierId, reqVO.getSuplierId())
                .orderByDesc(ModelFactoryDO::getId));
    }

}